<template>
  <div>
    <button @click="update">点击给数组重新赋值</button>
    <p v-for="item in arr" :key="item.id"> {{item.title}}</p>
  </div>
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'
// const arr = reactive({
//   todoList: [{
//     id: 1,
//     title: 'todo',
//     isDone: false
//   }]
// })

const arr = ref([
  {
    id: 1,
    title: 'todo',
    isDone: false
  }
])

const update = () => {
  arr.value = [{
    id: 2,
    title: 'newtodo',
    isDone: false
  }]
}
</script>

<style scoped>

</style>
